import './style.css'
import { Tabs } from 'antd-mobile'
import { useTabs } from './useTabs'
import HomeList from './HomeList'
// import { useSum } from './useSum'

function Home() {
    const { channels } = useTabs()
    // const { sumAdd, num, setNum } = useSum()
    return (
        <div>
            {/* <h4>{sumAdd}</h4>
            <h4>{num}</h4>
            <button onClick={() => { setNum(num + 1) }}>添加值</button> */}
            <div className="tabContainer">
                <Tabs defaultActiveKey={'0'}>
                    {channels?.map(item => (
                        <Tabs.Tab title={item.name} key={item.id}>
                            {/* 加上类名，严格控制滚动盒子 */}
                            <div className='listContainer'>
                                <HomeList channel_id={'' + item.id} />
                            </div>
                        </Tabs.Tab>
                    ))}
                </Tabs>
            </div>
        </div>
    )
}

export default Home